package org.jeecg.modules.accyentry.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.accyentry.entity.AccessoryEntry;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

/**
 * @Description:  配件出入库
 * @Author: jerryzhu
 * @Date:   2021-11-15
 * @Version: V1.0
 */
public interface AccessoryEntryMapper extends BaseMapper<AccessoryEntry> {
	
	/**查询出入库数据明细分页*/
	IPage<AccessoryEntry> selectAccessoryEntryPage(Page<AccessoryEntry> page, @Param(Constants.WRAPPER) Wrapper<AccessoryEntry> queryWrapper);

	/**查询仓库库存数据列表，不分页*/
	List<AccessoryEntry> getAccessoryEntryStorageSummaryList(@Param("storageId") String storageId);
	
	/**查询员工库存数据列表，不分页*/
	List<AccessoryEntry> getAccessoryEntryPersonSummaryList(@Param("userName") String userName);
	
	/**根据成色ID获取折足率*/
	@Select("select gold_content from gold_karat where id = #{karat}")
	String getGoldContentByKaratId(@Param("karat") String karat);

	/**根据ID获取仓库名字*/
	@Select("select name from accessory_storage where id = #{id}")
	String getStorageName(@Param("id") String id);

	/**通过配件编号查找配件信息*/
	@Select("select * from accessory_info where code_num = #{codeNum}")
	Map<String, String> queryAccessoryInfoByCodeNum(String codeNum);
}
